package cn.qdhlm.frontendprocessor.core.callback;

import cn.qdhlm.frontendprocessor.common.helper.RocketMqProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.nio.charset.StandardCharsets;

/**
 * @Name:HwNotifyApi
 * @description:
 * @author: xinY
 **/
@RestController
@RequestMapping("huawei/notify")
public class HwNotifyApi {
    @Autowired
    private RocketMqProducer producer;
    @PostMapping("device")
    public void notify(@RequestBody String message){
        producer.send("DeviceData","huawei-cloud",message.getBytes(StandardCharsets.UTF_8));
    }
}
